In [5]:
import pandas as pd
In [6]:
data = pd.read_table('daily_weather.tsv')
In [7]:
for i, row in enumerate(data['season_desc']):
if row == 'Spring':
data.set_value(i, 'season_desc', 'Winter')
elif row == 'Summer':
data.set_value(i, 'season_desc', 'Spring')
elif row == 'Fall':
data.set_value(i, 'season_desc', 'Summer')
elif row == 'Winter':
data.set_value(i, 'season_desc', 'Fall')
In [8]:
data.groupby('season_desc')['temp'].mean()
Out[8]:
In [ ]: